package pixelwaks.ctrl.impl;

import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.List;

import javax.swing.AbstractAction;
import javax.swing.JButton;

import pixelwaks.gui.impl.MainFrame;

import common.ctrl.IObserver;
import common.gui.IViewable;

@SuppressWarnings("serial")
public class SplashCtrl extends AbstractAction implements IObserver {


	private List<IViewable> observers = new ArrayList<IViewable>();



	@Override
	public void actionPerformed(ActionEvent e) {
		JButton ssStart = (JButton) this.getValue("Splash.ssStart");

		if(e.getSource() == ssStart) {
			updateView();
		}
	}
	@Override
	public void addView(IViewable iv) {
		// TODO Auto-generated method stub
		observers.add(iv);
	}
	private void updateView() {

		for (IViewable view : observers) {
			if(view.getClass() == MainFrame.class)
				view.updateView("splash");
		}
	}

}
